#ifndef CTRL_STEP_FW_BUTTON_STM32_H
#define CTRL_STEP_FW_BUTTON_STM32_H

#include "iSwitch.h"

class Button
{
public:
    Button(void);
    void SetLongPressTime(uint8_t id, uint32_t _longPressTime);
    void SetOnEventListener(void (*_callback)(uint8_t id, uint8_t events));
    bool IsPressed(uint8_t id);
    void Tick10ms(void);
private:
    static const uint8_t ButtonNum = 2;
    void (*callback)(uint8_t id, uint8_t events);
    iSW_t hisw[ButtonNum];
    bool ReadButtonPinIO(uint8_t id);
};

#endif
